<div class="users form">
<?php echo $this->Form->create('User');?>
	<fieldset>
 		<legend><?php __('Register'); ?></legend>
	<?php
		if (Configure::read('User.useUsername')) {
			echo $this->Form->input('username');
			$input = 'UserUsername';
		} else {
			$input = 'UserEmail';
		}
		echo $this->Form->input('email');
		echo $this->Form->input('password');
		echo $this->Form->input('password_confirm', array('type'=>'password'));
		echo $this->Form->input('first_name');
		echo $this->Form->input('last_name');
		if (Configure::read('System.useTimezone')) {
			echo $this->Form->input('timezone_id', array('options'=>$timezones, 'empty'=>__('select timezone', true)));
		}
	?>
	</fieldset>
<?php echo $this->Form->end(__('Register', true));?>
</div>

<script>
$(function() {
    $('#<?=$input?>').focus();
});
</script>